<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Why I Changed the Site's Build System - Kevin "The Nuclear" Bloom's Personal Website</title>
<link rel="shortcut icon" type="image/png" href="/img/guy-in-space.png"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org mode" />
<meta name="author" content="Kevin &quot;The Nuclear&quot; Bloom" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<link rel='stylesheet' href='/styles/main.2.css' />
</head>
<body>
<div id="preamble" class="status">
 <div id="banner">
  <h1><a href="/home.html">Kevin "The Nuclear" Bloom</a></h1>
  <hr />
  <div id="navit">
    <a href="/contact.html">Contact</a>
    &nbsp;
    <a href="/blog.html">Blog</a>
    &nbsp;
    <a href="/projects.html">Projects</a>
    &nbsp;
    <a href="/about-me.html">About Me</a>
  </div>
 </div>
</div>

<div id="content">

<div id="outline-container-org73932f1" class="outline-2">
<h2 id="org73932f1">Why I Changed the Site's Build System</h2>
<div class="outline-text-2" id="text-org73932f1">
<div class="PREVIEW">
<p>
I started off this website in <a href="https://common-lisp.net/">Common Lisp</a> then to org-mode and now finally to a
mixture of the two?! Well, okay, not really a mixture - more like a semi-similar
adaptation. Okay, that's not really true either&#x2026; Lemme just explain it simply:
the new build system using <a href="https://gnu.org/software/emacs">Emacs</a> <a href="https://orgmode.org">org-mode</a>, <a href="https://www.gnu.org/software/make/">make</a>, and a small <a href="https://fennel-lang.org">Fennel</a> script. Why
is this better than using plain old org? Let me explain&#x2026;
</p>

</div>


<p>
I started off writing the site with <a href="https://common-lisp.net/">Common Lisp</a> because I love Common Lisp! It's
the language that got me into software and one of my favorite languages! After
writing the site and sitting back to look at it, I realized that maybe it was
overkill to use Common Lisp to do this&#x2026; I mean, the site is 100% static&#x2026;
</p>


<p>
So, I looked elsewhere and found out how to use org-mode to make a site. I used
<a href="https://ogbe.net/">Dennis Ogbe's</a> <a href="https://ogbe.net/blog/blogging_with_org.html">guide</a> to do this. Surely <i>this</i> was the answer! - Not so
fast&#x2026; Very shortly after I finished the site <i>again</i>, I sat back and looked at
it and realized that org-mode updated and <code>:sitemap-function</code> changed&#x2026; Dennis
never updated his blog so I was left with a broken build system. I spent a lot
of time trying to get it working and came to the conclusion that this is <span class="underline">waaay</span>
too complicated just for the ease of org-mode's HTML exporting. I wonder, how
could I get the best of <i>both</i> worlds?
</p>


<p>
Around this time I was falling in love with <a href="https://fennel-lang.org">Fennel</a> due to me working on <a href="https://notabug.org/dragora/qire">qire</a>. I
had an idea! What if I wrote a little Fennel program that took some HTML for the
header and footer then mashed it together with some body HTML. That's where the
concept of my <a href="https://notabug.org/nuclearkev/website/src/master/pg.fnl">PG</a> (Page Generator) program can from. That was great but I didn't
want to have to write a bunch of HTML when I wanted to upload a new blog - and I
didn't want to have to compile each page one-by-one. That's when I came up with
the idea of using Emacs and make.
</p>


<p>
Turns out you can write emacs scripts&#x2026; Who knew?! So I did that and it takes
the org file, dumps it into a temp buffer, then exports it to HTML. Works like a
charm! Then we just put the emacs script and PG into a makefile and we're done!
Just run <code>make</code> and it will export the org files to HTML, parse the body, smash
it together, and put it into an output directory. Then you just server it! :)
</p>


<p>
How is this easier than just using org? Well, it's not necessarily <i>easier</i>,
it's <i>simpler</i>. What this mean is that you can clearly understand each step in
the process. With almost zero experience with emacs or org. Plus, I know that
it'll always work! Unless emacs no longer allows scripts or org's
<code>org-export-to-file</code> function stops working, it'll work. Yes, yes, it's "more
work" to add in a new blog - but c'mon, it's not that bad! Create the org file,
type in it, copy the information to properly link to it in the blog page, and
run <code>make</code>. That's not <i>too</i> difficult, is it?
</p>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Kevin "The Nuclear" Bloom</p>
</div>
<div id="footer">
  <hr />
  <p>
   <a href="https://anybrowser.org/campaign/">
    <img src="/img/any-browser.png" alt="Viewable with any browser! No JS, no cookies, no bullshit!"/></a>
    &nbsp;
    <a href="http://validator.w3.org/check?uri=nuclearkev.org"><img
      src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
    &nbsp;
    <a href="http://NetBSD.org/"><img
      src="https://www.netbsd.org/images/powered-by-NetBSD.png" alt="NetBSD" width="88" /></a>
  </p>
  <p>
    Copyright © 2017-2022 Kevin "The Nuclear" Bloom
  </p>
</div>
</body>
</html>
